package vn.fsoft.gst.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;



import vn.fsoft.gst.domain.User;
import vn.fsoft.gst.service.UserService;

@Controller
@RequestMapping("/user")
public class UserController {
	
	@Autowired
	private UserService userService;
	
	@RequestMapping(method = RequestMethod.GET)
	public String list(Model model) {
		List<User> users = userService.findAll();
		model.addAttribute("users", users);
		
		return "listUser";
	}

}
